const express = require('express');
const querystring = require('querystring');

const app = express();
app.listen(8080);

app.get('/reg', (req, res) => {
    res.sendFile(__dirname + "/reg.html");
});

app.post('/myreg', (req, res) => {
    req.on('data', (chunk) => {
        console.log(chunk.toString());
        let obj = querystring.parse(chunk.toString());
        console.log(obj);
    });

    //console.log(req.body);
    res.send('注册成功');
});